package com.ymt.reliable.message.domain;

import com.ymt.reliable.message.enums.MessageStatus;

public class TransactionMessageFactory {
    public static TransactionMessage createTransactionMessage(String messageBody, String consumerQueue, String field1) {
        return createTransactionMessage(messageBody, consumerQueue, field1, null, null);
    }

    public static TransactionMessage createTransactionMessage(String messageBody, String consumerQueue, String field1, String field2) {
        return createTransactionMessage(messageBody, consumerQueue, field1, field2, null);
    }

    public static TransactionMessage createTransactionMessage(String messageBody, String consumerQueue, String field1, String field2, String field3) {
        return createTransactionMessage(messageBody, consumerQueue, MessageStatus.WAITING_CONFIRM.getFlag(), field1, field2, field3);
    }

    public static TransactionMessage createTransactionMessage(String messageBody, String consumerQueue, String messageStatus, String field1, String field2, String field3) {
        TransactionMessage message = new TransactionMessage();
        message.setConsumerQueue(consumerQueue);
        message.setMessageBody(messageBody);
        message.setStatus(messageStatus);
        message.setField1(field1);
        message.setField2(field2);
        message.setField3(field3);
        return message;
    }
}
